package middlelayer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import sniff.pack.CommonPacket;

public class PacketBuffer {
	private static List<CommonPacket> allPackets = Collections.synchronizedList(new ArrayList<>());
	private static List<CommonPacket> showPackets = Collections.synchronizedList(new ArrayList<>());
	
	public static void appendToAllPackets(CommonPacket comPack) {
		allPackets.add(comPack);
	}

	public static void appendToShowPackets(CommonPacket comPack) {
		showPackets.add(comPack);
	}

	public static List<CommonPacket> getAllPackets() {
		return allPackets;
	}
	
	public static List<CommonPacket> getShowPackets() {
		return showPackets;
	}

	public static void setShowPackets(List<CommonPacket> showPackets) {
		PacketBuffer.showPackets = showPackets;
	}

	public static void cleanShow() {
		showPackets.clear();
	}

	public static void cleanAll() {
		allPackets.clear();
	}
	
}
